<template>
  <div class="app-content">
    <div class="payment" @click="Payment">立即支付</div>
  </div>
</template>

<script>
export default {
  name: "payment",
  data() {
    return {
      res: [],
      PaymentLink: '',
    }
  },
  methods: {
    Payment(){
      this.$apis.payment({
        orderid: this.res._id,
      })
        .then(data => {
          window.open(data.data.data, '_self');
          this.PaymentLink = data.data.data;
          console.log(this.PaymentLink);
        })
        .catch(error => {
          console.log(error);
        })
    }
  },
  created() {
    this.res = this.$route.params.data;
  }
}
</script>

<style scoped>
  .app-content{
    width: 100vw;
    height: 100vh;
  }
  .payment{
    position: absolute;
    left: 0;
    right: 0;
    top: 0;
    bottom: 0;
    margin: auto;
    width: 65vw;
    height: 70px;
    background: #63a35c;
    font-size: 30px;
    text-align: center;
    line-height: 70px;
    color: white;
    border-radius: 20px;
  }
</style>

